GBML manual / Input

btn_released

True this frame if button b is released (the frame it went up). Add a player number from 1 to 4 to ask another controller: btn_released(BTN_A, 2). Without one it is player 1.

Syntax

btn_released(b, player = 1) -> bool

Arguments

NameType
bbutton
playerint (can be left out; then it is 1)

Returns

bool

Description

True this frame if a given button is released.

True on exactly one frame: the frame a button goes back up. Less commonly needed than btn_held/btn_pressed, but the natural fit for anything that should happen on release, like the roll-dash IGUN's own action button uses (see what is unavailable for how much of that specific mechanic exists here today).

Another player

Write a player number from 1 to 4 after the button to ask that player's controller: btn_released(BTN_A, 2). Leave it out and it is player 1, the same as writing 1. The number has to be written out in the call (not kept in a variable), and a console that has fewer controllers than that tells you so when you check the game: the Game Boy Advance has one, so only player 1 works there.

Example

if (btn_released(BTN_A)) {
    var pressed_a = true;
}

Checks the A button's released state every frame and records it in a project-defined pressed_a variable.

On the GBA

The Game Boy Advance has one controller, so only player 1 can be asked here (written out or left out, it is the same call).

See also: btn_heldbtn_pressedBTN_A